
cd "C:\Users\wie-dainn\Dropbox\Work\Yema\Analysis.CH2"

******************
*Parallel Trends
******************

use "Data\ESS_2013_2015_hh_acled_final.DTA", clear
append using  "Data\ESS_2018_2021_hh_acled_final.DTA", force

gen round=1
replace round=2 if Year>2015
egen npid=group(round pid)
gen treated20=exposed_dummy_20

*keep if sex_new==1

collapse (mean) attending_school worked_free_others free_labor_public [pweight = hh_weight], by(Year treated20)

gen t = .
replace t = 1 if Year==2013
replace t = 2 if Year==2015
replace t = 3 if Year==2018
replace t = 4 if Year==2021
label define t 1 "2013" 2 "2015" 3 "2018/19" 4 "2021/22", replace
label values t t


twoway ///
    (line attending_school t if treated20==0 & inlist(t,1,2), sort lcolor(navy)) ///
    (line attending_school t if treated20==0 & inlist(t,3,4), sort lcolor(navy)) ///
    (line attending_school t if treated20==1 & inlist(t,1,2), sort lcolor(maroon)) ///
    (line attending_school t if treated20==1 & inlist(t,3,4), sort lcolor(maroon)) ///
    (scatter attending_school t if treated20==0, msymbol(O) mcolor(navy)) ///
    (scatter attending_school t if treated20==1, msymbol(O) mcolor(maroon)), ///
    legend(order(1 "Control" 3 "Treated")) ///
    xlabel(1 "2013" 2 "2015" 3 "2018/19" 4 "2021/22") ///
	xtitle("Survey rounds") ytitle("Share attending school") ///
	
graph export "Figures\figure3a.jpg", replace
graph export "Figures\figure3a.emf", replace

twoway ///
    (line worked_free_others t if treated20==0 & inlist(t,1,2), sort lcolor(navy)) ///
    (line worked_free_others t if treated20==0 & inlist(t,3,4), sort lcolor(navy)) ///
    (line worked_free_others t if treated20==1 & inlist(t,1,2), sort lcolor(maroon)) ///
    (line worked_free_others t if treated20==1 & inlist(t,3,4), sort lcolor(maroon)) ///
    (scatter worked_free_others t if treated20==0, msymbol(O) mcolor(navy)) ///
    (scatter worked_free_others t if treated20==1, msymbol(O) mcolor(maroon)), ///
    legend(order(1 "Control" 3 "Treated")) ///
    xlabel(1 "2013" 2 "2015" 3 "2018/19" 4 "2021/22") ///
	xtitle("Survey rounds") ytitle("Share working unpaid")	
	
graph export "Figures\figure3b.jpg", replace
graph export "Figures\figure3b.emf", replace


/
